﻿using NUnit.Framework;

namespace CardGameFramework.Tests
{

    [TestFixture]
    class HandTests
    {
        private Deck _deck;

        #region Setup and TearDown
        [SetUp]
        public void Setup()
        {
            _deck = new Deck();
        }

        [TearDown]
        public void TearDown()
        {
            _deck = null;
        }
        #endregion

        #region Test Methods

        [Test]
        public void ctor_HandCreated_PileStateEqualsBuilding()
        {
            var hand = new Hand(0, 5, 5);
            var expected = PileStates.Building;
            var result = hand.PileState;
            Assert.AreEqual(expected, result);
        }

        [Test]
        public void AddCard_AttemptToAddCardToFullHand_CardNotAdded()
        {
            var hand = new Hand(0, 5, 5);
            hand.AddCard(new Card(Suits.Spades, Ranks.Ten));
            hand.AddCard(new Card(Suits.Spades, Ranks.Jack));
            hand.AddCard(new Card(Suits.Spades, Ranks.Queen));
            hand.AddCard(new Card(Suits.Spades, Ranks.King));
            hand.AddCard(new Card(Suits.Spades, Ranks.Ace));
            Assert.AreEqual(5, hand.Cards.Count);

            hand.AddCard(new Card(Suits.Joker, Ranks.LittleJoker));
            Assert.AreEqual(5, hand.Cards.Count);
        }


        
        #endregion
    }

    
}